home *** CD-ROM | disk | FTP | other *** search
- package views
- {
- import events.NavigationEvent;
- import flash.accessibility.*;
- import flash.debugger.*;
- import flash.display.*;
- import flash.errors.*;
- import flash.events.*;
- import flash.external.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.media.*;
- import flash.net.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.system.*;
- import flash.text.*;
- import flash.ui.*;
- import flash.utils.*;
- import flash.xml.*;
- import model.PresentationModel;
- import mx.binding.*;
- import mx.containers.Canvas;
- import mx.controls.Image;
- import mx.core.UIComponentDescriptor;
- import mx.core.mx_internal;
- import mx.events.PropertyChangeEvent;
- import mx.styles.*;
-
- public class Content extends Canvas
- {
- private static var _watcherSetupUtil:IWatcherSetupUtil;
-
- private var shadowBottom:Class;
-
- private var _bindings:Array;
-
- [Bindable]
- private var _607087477_Image1:Image;
-
- private var shadowTop:Class;
-
- public var _bindingsByDestination:Object;
-
- [Bindable]
- private var _1559026522browseIssueTab:BrowseIssueTab;
-
- [Bindable]
- private var _1732677141spreadsTab:SpreadsTab;
-
- [Bindable]
- private var _2062164946browseYearTab:BrowseYearTab;
-
- [Bindable]
- private var _607087478_Image2:Image;
-
- [Bindable]
- private var _1778196685searchTab:SearchTab;
-
- public var _bindingsBeginWithWord:Object;
-
- [Bindable]
- private var _3496342read:Read;
-
- [Bindable]
- private var _1857328081presentationModel:PresentationModel;
-
- [Bindable]
- private var _895684237spread:Spread;
-
- private var _watchers:Array;
-
- private var _documentDescriptor_:UIComponentDescriptor;
-
- public function Content()
- {
- _documentDescriptor_ = new UIComponentDescriptor({
- "type":Canvas,
- "propertiesFactory":function():Object
- {
- return {
- "height":934,
- "childDescriptors":[new UIComponentDescriptor({
- "type":Image,
- "id":"_Image1",
- "stylesFactory":function():void
- {
- this.bottom = 0;
- }
- }),new UIComponentDescriptor({
- "type":Image,
- "id":"_Image2",
- "stylesFactory":function():void
- {
- this.top = 0;
- }
- }),new UIComponentDescriptor({
- "type":Read,
- "id":"read",
- "propertiesFactory":function():Object
- {
- return {
- "x":0,
- "visible":false
- };
- }
- }),new UIComponentDescriptor({
- "type":Spread,
- "id":"spread",
- "propertiesFactory":function():Object
- {
- return {"visible":false};
- }
- }),new UIComponentDescriptor({
- "type":SpreadsTab,
- "id":"spreadsTab",
- "stylesFactory":function():void
- {
- this.bottom = 0;
- },
- "propertiesFactory":function():Object
- {
- return {
- "x":5,
- "visible":false
- };
- }
- }),new UIComponentDescriptor({
- "type":SearchTab,
- "id":"searchTab",
- "stylesFactory":function():void
- {
- this.top = 0;
- },
- "propertiesFactory":function():Object
- {
- return {
- "x":5,
- "visible":false
- };
- }
- }),new UIComponentDescriptor({
- "type":BrowseYearTab,
- "id":"browseYearTab",
- "events":{"yearSelect":"__browseYearTab_yearSelect"},
- "stylesFactory":function():void
- {
- this.horizontalCenter = 6;
- this.top = 0;
- },
- "propertiesFactory":function():Object
- {
- return {"visible":false};
- }
- }),new UIComponentDescriptor({
- "type":BrowseIssueTab,
- "id":"browseIssueTab",
- "events":{"issueSelect":"__browseIssueTab_issueSelect"},
- "stylesFactory":function():void
- {
- this.horizontalCenter = 6;
- this.top = 0;
- },
- "propertiesFactory":function():Object
- {
- return {"visible":false};
- }
- })]
- };
- }
- });
- shadowBottom = Content_shadowBottom;
- shadowTop = Content_shadowTop;
- super();
- mx_internal::_document = this;
- this.percentWidth = 100;
- this.height = 934;
- this.horizontalScrollPolicy = "off";
- this.verticalScrollPolicy = "off";
- }
-
- public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
- {
- Content._watcherSetupUtil = param1;
- }
-
- [Bindable(event="propertyChange")]
- public function get browseYearTab() : BrowseYearTab
- {
- return this._2062164946browseYearTab;
- }
-
- public function nextResultHandler(param1:NavigationEvent) : void
- {
- searchTab.nextResult();
- }
-
- public function readMode() : void
- {
- read.visible = true;
- spread.visible = false;
- spreadsTab.visible = false;
- searchTab.visible = false;
- }
-
- public function set browseYearTab(param1:BrowseYearTab) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._2062164946browseYearTab;
- if(_loc2_ !== param1)
- {
- this._2062164946browseYearTab = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"browseYearTab",_loc2_,param1));
- }
- }
-
- public function __browseYearTab_yearSelect(param1:NavigationEvent) : void
- {
- yearSelectHandler(param1);
- }
-
- public function set presentationModel(param1:PresentationModel) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1857328081presentationModel;
- if(_loc2_ !== param1)
- {
- this._1857328081presentationModel = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"presentationModel",_loc2_,param1));
- }
- }
-
- public function searchTextChangeHandler(param1:NavigationEvent) : void
- {
- spreadsTab.visible = false;
- searchTab.visible = true;
- searchTab.simpleSearch(param1.eventData as String);
- }
-
- [Bindable(event="propertyChange")]
- public function get browseIssueTab() : BrowseIssueTab
- {
- return this._1559026522browseIssueTab;
- }
-
- [Bindable(event="propertyChange")]
- public function get presentationModel() : PresentationModel
- {
- return this._1857328081presentationModel;
- }
-
- [Bindable(event="propertyChange")]
- public function get searchTab() : SearchTab
- {
- return this._1778196685searchTab;
- }
-
- private function _Content_bindingsSetup() : void
- {
- var binding:Binding = null;
- if(!_bindings)
- {
- _bindings = [];
- }
- if(!_watchers)
- {
- _watchers = [];
- }
- binding = new Binding(this,function():Object
- {
- return shadowBottom;
- },function(param1:Object):void
- {
- _Image1.source = param1;
- },"_Image1.source");
- _bindings[0] = binding;
- binding = new Binding(this,function():Object
- {
- return shadowTop;
- },function(param1:Object):void
- {
- _Image2.source = param1;
- },"_Image2.source");
- _bindings[1] = binding;
- binding = new Binding(this,function():String
- {
- var _loc1_:* = undefined;
- var _loc2_:* = undefined;
- _loc1_ = presentationModel.imageURL;
- return _loc1_ == undefined ? null : String(_loc1_);
- },function(param1:String):void
- {
- read.imageURL = param1;
- },"read.imageURL");
- _bindings[2] = binding;
- binding = new Binding(this,function():String
- {
- var _loc1_:* = undefined;
- var _loc2_:* = undefined;
- _loc1_ = presentationModel.imageURL;
- return _loc1_ == undefined ? null : String(_loc1_);
- },function(param1:String):void
- {
- spread.imageURL = param1;
- },"spread.imageURL");
- _bindings[3] = binding;
- binding = new Binding(this,function():int
- {
- return presentationModel.currentPage;
- },function(param1:int):void
- {
- spread.cover = param1;
- },"spread.cover");
- _bindings[4] = binding;
- binding = new Binding(this,function():PresentationModel
- {
- return presentationModel;
- },function(param1:PresentationModel):void
- {
- spreadsTab.presentationModel = param1;
- },"spreadsTab.presentationModel");
- _bindings[5] = binding;
- binding = new Binding(this,function():PresentationModel
- {
- return presentationModel;
- },function(param1:PresentationModel):void
- {
- searchTab.presentationModel = param1;
- },"searchTab.presentationModel");
- _bindings[6] = binding;
- binding = new Binding(this,function():PresentationModel
- {
- return presentationModel;
- },function(param1:PresentationModel):void
- {
- browseYearTab.presentationModel = param1;
- },"browseYearTab.presentationModel");
- _bindings[7] = binding;
- binding = new Binding(this,function():PresentationModel
- {
- return presentationModel;
- },function(param1:PresentationModel):void
- {
- browseIssueTab.presentationModel = param1;
- },"browseIssueTab.presentationModel");
- _bindings[8] = binding;
- }
-
- public function prevResultHandler(param1:NavigationEvent) : void
- {
- searchTab.prevResult();
- }
-
- public function set spreadsTab(param1:SpreadsTab) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1732677141spreadsTab;
- if(_loc2_ !== param1)
- {
- this._1732677141spreadsTab = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"spreadsTab",_loc2_,param1));
- }
- }
-
- public function __browseIssueTab_issueSelect(param1:NavigationEvent) : void
- {
- issueSelectHandler(param1);
- }
-
- public function set browseIssueTab(param1:BrowseIssueTab) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1559026522browseIssueTab;
- if(_loc2_ !== param1)
- {
- this._1559026522browseIssueTab = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"browseIssueTab",_loc2_,param1));
- }
- }
-
- private function yearSelectHandler(param1:NavigationEvent) : void
- {
- browseYearTab.visible = false;
- browseIssueTab.visible = true;
- dispatchEvent(param1);
- }
-
- [Bindable(event="propertyChange")]
- public function get spread() : Spread
- {
- return this._895684237spread;
- }
-
- [Bindable(event="propertyChange")]
- public function get read() : Read
- {
- return this._3496342read;
- }
-
- public function set searchTab(param1:SearchTab) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1778196685searchTab;
- if(_loc2_ !== param1)
- {
- this._1778196685searchTab = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"searchTab",_loc2_,param1));
- }
- }
-
- public function spreadMode() : void
- {
- read.visible = false;
- spread.visible = true;
- }
-
- public function spreadsTabToggle() : void
- {
- spreadsTab.visible = !spreadsTab.visible;
- if(spreadsTab.visible)
- {
- searchTab.visible = false;
- }
- trace("spreadsTabToggle " + spreadsTab.visible);
- }
-
- public function showSomething() : void
- {
- if(!read.visible)
- {
- if(!spread.visible)
- {
- spreadMode();
- }
- }
- }
-
- [Bindable(event="propertyChange")]
- public function get spreadsTab() : SpreadsTab
- {
- return this._1732677141spreadsTab;
- }
-
- private function issueSelectHandler(param1:NavigationEvent) : void
- {
- browseIssueTab.visible = false;
- dispatchEvent(param1);
- }
-
- public function searchTabToggle() : void
- {
- searchTab.visible = !searchTab.visible;
- if(searchTab.visible)
- {
- spreadsTab.visible = false;
- }
- trace("searchTabToggle " + searchTab.visible);
- }
-
- private function _Content_bindingExprs() : void
- {
- var _loc1_:* = undefined;
- _loc1_ = shadowBottom;
- _loc1_ = shadowTop;
- _loc1_ = presentationModel.imageURL;
- _loc1_ = presentationModel.imageURL;
- _loc1_ = presentationModel.currentPage;
- _loc1_ = presentationModel;
- _loc1_ = presentationModel;
- _loc1_ = presentationModel;
- _loc1_ = presentationModel;
- }
-
- public function browseByCoverToggle() : void
- {
- if(true == browseYearTab.visible || true == browseIssueTab.visible)
- {
- browseYearTab.visible = false;
- browseIssueTab.visible = false;
- }
- else if(1 < presentationModel.years.length)
- {
- browseYearTab.visible = true;
- }
- else
- {
- browseIssueTab.visible = true;
- }
- }
-
- public function set spread(param1:Spread) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._895684237spread;
- if(_loc2_ !== param1)
- {
- this._895684237spread = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"spread",_loc2_,param1));
- }
- }
-
- public function set _Image1(param1:Image) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._607087477_Image1;
- if(_loc2_ !== param1)
- {
- this._607087477_Image1 = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Image1",_loc2_,param1));
- }
- }
-
- public function set _Image2(param1:Image) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._607087478_Image2;
- if(_loc2_ !== param1)
- {
- this._607087478_Image2 = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Image2",_loc2_,param1));
- }
- }
-
- public function set read(param1:Read) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._3496342read;
- if(_loc2_ !== param1)
- {
- this._3496342read = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"read",_loc2_,param1));
- }
- }
-
- [Bindable(event="propertyChange")]
- public function get _Image2() : Image
- {
- return this._607087478_Image2;
- }
-
- override public function initialize() : void
- {
- var target:Content = null;
- var watcherSetupUtilClass:Object = null;
- mx_internal::setDocumentDescriptor(_documentDescriptor_);
- _Content_bindingsSetup();
- target = this;
- if(_watcherSetupUtil == null)
- {
- watcherSetupUtilClass = getDefinitionByName("_views_ContentWatcherSetupUtil");
- watcherSetupUtilClass["init"](null);
- }
- _watcherSetupUtil.setup(this,function(param1:String):*
- {
- return target[param1];
- },_bindings,_watchers);
- super.initialize();
- }
-
- [Bindable(event="propertyChange")]
- public function get _Image1() : Image
- {
- return this._607087477_Image1;
- }
-
- public function hideTabs() : void
- {
- searchTab.visible = false;
- spreadsTab.visible = false;
- }
- }
- }
-
-